/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 */

package com.huawei.api.bean;

import com.huawei.api.constants.Constant;

import com.beust.jcommander.Parameter;

import lombok.Data;

/**
 * 脚本参数名称定义
 *
 * @since 2023/10/28
 */
@Data
public class ClientParameter {
    @Parameter(names = "--checker", description = "指定扫描规则")
    private String checker;

    @Parameter(names = "--output", description = "输出报告路径")
    private String output;

    @Parameter(names = {"-format", "--format"}, description = "文件格式(xml/txt/json)")
    private ReportType format = ReportType.JSON;

    @Parameter(names = "--source", description = "待扫描的源码路径")
    private String source;

    @Parameter(names = "--include", description = "待分析的文件路径")
    private String includeFiles;

    @Parameter(names = "--exclude", description = "排除在外的文件路径")
    private String excludeFiles;

    @Parameter(names = "--type", description = "调用类型，0：本地运行, 1：集成华为云")
    private String type = UseType.INTEGRATED.type;

    @Parameter(names = "--tool_path", description = "引擎路径")
    private String toolPath;

    @Parameter(names = "--uccp_path", description = "uccp插件路径")
    private String uccpPath;

    @Parameter(names = "--param_file_path", description = "参数文件路径")
    private String paramFilePath;

    @Parameter(names = "--branch", description = "分支")
    private String branch;

    public boolean isAll() {
        return Constant.ALL.equalsIgnoreCase(this.checker);
    }
}
